﻿Imports Cls_Common
Imports VSModel
Partial Class FrontEnd_Control_Home_CenterBanner
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Bind2Repeater()
        End If
    End Sub

    Protected Sub Bind2Repeater()
        Using _data As New VSEntities
            Dim p = (From q In _data.ImagesAdvers Where q.StatusID = 3 And q.Subject = ImageAdverType.BannerHome
                     Select q Order By q.Sort).FirstOrDefault
            If Not p Is Nothing Then
                imgBig.ImageUrl = p.SRC
                hplTitle.NavigateUrl = p.URL
                imgBig.AlternateText = p.Title
            End If          
        End Using
    End Sub
End Class
